<!--用户中心-->
<template>
	<view class="c_bg">
		<view style="height: 53rpx;"></view>
		<view class="mx-24">
			<navigator url="yonghurenzheng" class="white round-8 px-24 py-28">
				<view class="flex flex-row flex-row-center-between">
					<view class="flex flex-row flex-row-center-start">
						<view class="c_kd rounded">
							<view class="flex flex-center">
								<!-- <tm-image :round="0" :width="110" :height="110" :src="imgHost('c_10.png')"></tm-image> -->
								<view class="flex flex-center text-size-m text-white" style="width:110rpx;height:110rpx;border-radius: 50%;background:rgba(0,115,255,1)">
								{{ (user.userinfo.realname||"A")[0] }}
								</view>


							</view>
						</view>
						<view class="ml-14">
							<view class="text-size-lg text-weight-b">{{ user.userinfo.company_name || user.userinfo.realname || '点击认证' }}</view>
						    <view class="text-size-m c_wenhui pt-10">{{ user.userinfo.company_name?(user.userinfo.realname?user.userinfo.realname+ " - ":""):""}}{{ user.userinfo.mobile||'手机号未填写' }}</view>
						</view>
					</view>
					<view class="c_rzimg">
						<!--机构已认证-->
						<tm-image :round="0" :width="133" :height="54" :src="getStatsImg(user.userinfo.auth.auth_state,user.userinfo.auth.auth_type)"></tm-image>

					</view>
				</view>
			</navigator>
			<view class="white round-8 mt-12 px-40 py-26">
				<view class="flex flex-row flex-row-center-between">
					<navigator :url="user.userinfo.auth.auth_state?'/pages/user/wofabude':'/pages/user/yonghurenzheng'" class="flex flex-center c_jz">
						<view>
							<tm-icon color="#0073FF" :line-height="0" :font-size="50" name="tmicon-edit"></tm-icon>
						</view>
						<view class="text-size-m c_danhei pt-10">我发布的</view>
					</navigator>
					<navigator :url="user.userinfo.auth.auth_state?'/pages/user/wofabude?state=1':'/pages/user/yonghurenzheng'" class="flex flex-center c_jz">
						<view>
							<tm-icon color="#0073FF" :line-height="0" :font-size="50" name="tmicon-ios-alarm"></tm-icon>
						</view>
						<view class="text-size-m c_danhei pt-10">待审核</view>
					</navigator>
					<navigator :url="user.userinfo.auth.auth_state?'/pages/user/wofabude?state=2':'/pages/user/yonghurenzheng'" class="flex flex-center c_jz">
						<view>
							<tm-icon color="#0073FF" :line-height="0" :font-size="50" name="tmicon-check-circle"></tm-icon>
						</view>
						<view class="text-size-m c_danhei pt-10">已审核</view>
					</navigator>
					<navigator :url="'/pages/user/wodeshouchang'" class="flex flex-center c_jz">
						<view>
							<tm-icon color="#0073FF" :line-height="0" :font-size="50" name="tmicon-collection"></tm-icon>
						</view>
						<view class="text-size-m c_danhei pt-10">我的收藏</view>
					</navigator>
				</view>
			</view>
			<navigator url="yonghurenzheng" class="mt-18 white round-8 px-26 py-24">
				<view class="flex flex-row flex-row-center-between">
					<view class="text-size-g">用户认证资料</view>
					<view>
						<tm-icon color="#0073FF" :line-height="0" :font-size="24" name="tmicon-angle-right"></tm-icon>
					</view>
				</view>
			</navigator>
			<navigator :url="user.userinfo.auth.auth_state?'woshoudaodezixun':'yonghurenzheng'" class="mt-18 white round-8 px-26 py-24">
				<view class="flex flex-row flex-row-center-between">
					<view class="text-size-g">我收到的咨询</view>
					<view>
						<tm-icon color="#0073FF" :line-height="0" :font-size="24" name="tmicon-angle-right"></tm-icon>
					</view>
				</view>
			</navigator>
			<view style="height:86rpx;"></view>
			<tm-button  :url="user.userinfo.auth.auth_state?'/pages/index/fabuchengguo':'/pages/user/yonghurenzheng'" block :round="3" icon="tmicon-upload" label="发布项目"></tm-button>
		</view>
	</view>
</template>

<script lang="ts" setup>
import { ref,computed } from "vue"
import { imgHost } from "@/libs/imgHost";
import { useStoreUser } from "@/libs/useStoreUser";
import { onShow } from "@dcloudio/uni-app";
const user = useStoreUser();


onShow(()=>{
	user.getUserInfo();
})
const getStatsImg = computed(()=>{
	return (status:boolean,type:number)=>{
		if(type==1) return status?imgHost("c_a1.png"):imgHost("c_a0.png");
		if(type==2) return status?imgHost("c_e1.png"):imgHost("c_e0.png");
		if(type==3) return status?imgHost("c_d1.png"):imgHost("c_d0.png");
		if(type==4) return status?imgHost("c_c1.png"):imgHost("c_c0.png");
		if(type==5) return status?imgHost("c_b1.png"):imgHost("c_b0.png");
		return imgHost("c_w.png");
	}
})
</script>

<style>
page {
	background: #F7F7F7;
}
</style>
<style lang="less" scoped>
	.c_bg{
		width: 750rpx;
		height: 141rpx;
		background: #0073FF;
		border-radius: 0rpx 0rpx 125rpx 125rpx;
	}
	.c_kd{
		width: 110rpx;
		height: 110rpx;
		background: #D8D8D8;
		overflow: hidden;
	}
	.c_rzimg{
		width: 133rpx;
		height: 54rpx;
	}
	.c_jz{
		align-items: center;
		align-content: center;
		flex-wrap: wrap;
		flex-direction: column;
	}
</style>